package com.eddie.responsibilitychain;

/**
 * 具体处理器
 * @author Eddie
 * @date 2022/08/08 15:50
 **/
public class DepartmentAppRover extends AppRover {
    public DepartmentAppRover(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        if (purchaseRequest.getPrice() <= 5000) {
            System.out.println("请求编号：" + purchaseRequest.getId() + "被" + getName() + "处理");
        } else {
            this.getAppRover().processRequest(purchaseRequest);
        }
    }
}
